﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using My.Data.DataAccess;
using NHibernate;

namespace My.Data.Factories
{
    public class DataAccessFactory
    {
        #region Static Methods

        /// <summary>
        /// Loads the person DAO.
        /// </summary>
        /// <returns></returns>
        public static IPersonDao LoadPersonDao()
        {
            ISession session = ISessionManager.Instance.CreateISession();
            return new PersonDao(session);
        }

        public static ILoginDao LoadLoginDao()
        {
            ISession session = ISessionManager.Instance.CreateISession();
            return new LoginDao(session);
        }

        public static ITL1Dao LoadTL1Dao()
        {
            ISession session = ISessionManager.Instance.CreateISession();
            return new TL1Dao(session);
        }

        public static IAuthenticationDao LoadAuthenticationDao()
        {
            ISession session = ISessionManager.Instance.CreateISession();
            return new AuthenticationDao(session);
        }

        #endregion
    }
}
